/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* 游戏容器 */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 1200px;
    width: 90%;
    min-height: 600px;
}

/* 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 15px;
    color: white;
}

.game-title {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-info {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    font-weight: bold;
}

.game-info div {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* 游戏主体 */
.game-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 区域通用样式 */
.queue-area, .control-area, .preview-area {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.queue-area h2, .control-area h2, .preview-area h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-align: center;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

/* 排队区域 */
.queue-container {
    min-height: 300px;
    background: linear-gradient(to bottom, #e8f5e8, #d4edda);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    border: 3px solid #28a745;
}

.queue-counter {
    text-align: center;
    font-weight: bold;
    color: #28a745;
    margin-top: 15px;
    font-size: 1.1em;
}

/* 蛋仔样式 */
.egg {
    background: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: eggFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid #ddd;
}

.egg:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.egg.normal {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    border-color: #ff6b6b;
}

.egg.golden {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-color: #ffa500;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.egg.rainbow {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    animation: rainbowMove 3s ease-in-out infinite, eggFloat 3s ease-in-out infinite;
}

@keyframes eggFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes rainbowMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 控制区域 */
.spawn-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.egg-types {
    margin-top: 20px;
}

.egg-types h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.egg-type-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.egg-type-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.egg-type-selector label:hover {
    background: #e9ecef;
}

/* 按钮样式 */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 预览区域 */
.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-radius: 10px;
    padding: 20px;
}

.preview-egg {
    font-size: 4em;
    animation: previewRotate 4s linear infinite;
}

@keyframes previewRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 游戏控制区 */
.game-footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalBounce 0.5s ease-out;
}

@keyframes modalBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-info div {
        margin: 5px 0;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 10px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}